// console.log(111);
import $ from './jquery.esm.js'
import countDown from "./DS.js";
// import {main4_tab,main4_buttomtab,rmd_tab} from './tabs.js';
// console.log(main4_tab)
// main4_tab();
// main4_buttomtab();
// rmd_tab();
// import $ from './lib/jquery.esm.js';

$.ajax({
  type: "get",
  url: "../../interface/getitems.php",
  dataType: "json"
}).then(res => {

  let template = '';
// console.log(res);
  res.forEach(el => {
  
    let pic = JSON.parse(el.picture);
    // console.log(pic)
    // console.log(pic);
    // console.log(el.price);
    template += `<div><a href="../html/XQ.html?id=${el.id}" target="_blank">
    <div class="box8-img">
      <img src="./${pic[0].src}" alt="${pic[0].alt}">
    </div>
    <div class="box8-text">
      <p>${el.title}</p>
      <p><span>￥${el.price}</span></p>
      <p>55227人已购买</p>
    </div>
  </div> </a>`;
  });


  $('.box8-bottom').html(template);

}).catch(xhr => {
  // console.log(xhr.status);
});